package com.skillworld.webapp.model.department;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="departmentranking")
public class DepartmentRanking {

    private Long deptRankingId;
    private Date date;
    private Department departmentId1;
    private Department departmentId2;
    private Department departmentId3;
    private Department departmentId4;
    private Department departmentId5;
    
    public DepartmentRanking(){
        
    }
    
    public DepartmentRanking(Date date,
            Department departmentId1, Department departmentId2,
            Department departmentId3, Department departmentId4,
            Department departmentId5) {
        
        this.date = date;
        this.departmentId1 = departmentId1;
        this.departmentId2 = departmentId2;
        this.departmentId3 = departmentId3;
        this.departmentId4 = departmentId4;
        this.departmentId5 = departmentId5;
    }

    @SequenceGenerator(name="DepartmentRankingIdGenerator",sequenceName="DepartmentRankingSeq")
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO,generator="DepartmentRankingIdGenerator")
    @Column(name="idRankingD")
    public Long getDeptRankingId() {
        return deptRankingId;
    }

    public void setDeptRankingId(Long deptRankingId) {
        this.deptRankingId = deptRankingId;
    }

    @Column(name = "date")
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idDepartment1")
    public Department getDepartmentId1() {
        return departmentId1;
    }

    public void setDepartmentId1(Department departmentId1) {
        this.departmentId1 = departmentId1;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idDepartment2")
    public Department getDepartmentId2() {
        return departmentId2;
    }

    public void setDepartmentId2(Department departmentId2) {
        this.departmentId2 = departmentId2;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idDepartment3")
    public Department getDepartmentId3() {
        return departmentId3;
    }

    public void setDepartmentId3(Department departmentId3) {
        this.departmentId3 = departmentId3;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idDepartment4")
    public Department getDepartmentId4() {
        return departmentId4;
    }

    public void setDepartmentId4(Department departmentId4) {
        this.departmentId4 = departmentId4;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idDepartment5")
    public Department getDepartmentId5() {
        return departmentId5;
    }

    public void setDepartmentId5(Department departmentId5) {
        this.departmentId5 = departmentId5;
    }
    
}
